<html>
<head><meta charset="utf-8"><title>const intrinsics::assume · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/const.20intrinsics.3A.3Aassume.html">const intrinsics::assume</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="229483358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/const%20intrinsics%3A%3Aassume/near/229483358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Soveu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/const.20intrinsics.3A.3Aassume.html#229483358">(Mar 09 2021 at 14:17)</a>:</h4>
<p>Is it be possible for <code>intrinsics::assume</code> to be a const function to make it usable in const functions?<br>
It would be work-around for some issues like this one<br>
<a href="https://github.com/rust-lang/rust/issues/82224">https://github.com/rust-lang/rust/issues/82224</a></p>



<a name="229484018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/const%20intrinsics%3A%3Aassume/near/229484018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/const.20intrinsics.3A.3Aassume.html#229484018">(Mar 09 2021 at 14:22)</a>:</h4>
<p>The most appropriate fix almost always (99.manynine% of cases) will not involve the <code>assume</code> intrinsic.</p>



<a name="229484066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/const%20intrinsics%3A%3Aassume/near/229484066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/const.20intrinsics.3A.3Aassume.html#229484066">(Mar 09 2021 at 14:22)</a>:</h4>
<p>In this particular case giving more <code>!range</code> metadata to <code>LLVM</code> is probably more appropriate.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>